Emission of electromagnetic radiation from the early stages of relativistic heavy-ion collisions