Emission of coherent microwave radiation from a relativistic electron beam propagating in a spatially modulated field