Theory of photon echoes from interacting impurities in crystals with inhomogeneously broadened absorption spectra