Radiative instability of a relativistic electron beam moving in a photonic crystal