There is a standard way to quantize (non-relativisticly) the EM field. Based on the classical energy density
$$H = \frac{1}{8\pi}\int\! d^3r \left[|\vec{E}(\vec{r})|^2+|\vec{B}(\vec{r})|^2\right]$$
We write everything in terms of the vector potential $$\vec{A}(\vec{r},t)$$ which we expand in plain waves $\vec{q}_{\vec{k}}(t) e^{i\vec{k} \vec{r}}$. Note that we do not make any assumptions about the time-dependent, or the frequency. That will come out naturally. Then from the Hamiltonian is
$$ H = \sum_{\vec{k}} |\dot{\vec{q}}_{\vec{k}}|^2 + \omega_{\vec{k}} |\vec{q}_{\vec{k}}|^2$$
with $\omega_{\vec{k}} = c|\vec{k}|$. Now we quantize these modes, with $p=\dot{q}$ the conjugate momenta of $q$, and you see that the EM field is described as sum of Harmonic oscillators. The creation and annihilation operators of these "Harmonic oscillators" add or remove a quanta of $\hbar\omega_{\vec{k}}$ from the field, and these are the photons.
You can work out how $\vec{E}$ and $\vec{B}$ look in terms of these fields, and you get that $\vec{E}$ has expansion in modes that propagate like the calssical fields, that is with an exponent of $i(\vec{k}\vec{r}-\omega_\vec{k} t)$.
A nice point here is that for a state of the field with a well-defined number of photons, the expectation value of both the electric and magnetic field is zero (just like that the momenta and position of the Harmonic oscillator is zero for a state with well defined $n$). You need a coherent state in order to describe the classical limit. In fact - this is the origin of the term "coherent state", as it was born in quantum optics!
More detailed equations can be found in the wikipedia page on the subject.