Virtual photon description of B and E fields
the wave function of a single photon has several components - much like the components of the Dirac field (or Dirac wave function) - and this wave function is pretty much isomorphic to the electromagnetic field, remembering the complexified values of $E$ and $B$ vectors at each point. The probability density that a photon is found at a particular point is proportional to the energy density $(E^2+B^2)/2$ at this point. But again, the interpretation of $B,E$ for a single photon has to be changed.
So whether the field around an object is electric or magnetic or both is encoded in the "polarization" of the virtual photons.
You may imagine that the photon has 6 possible polarizations or so, identified with the components of $E$ and $B$. Well, for a particular direction, it is really just the $E+iB$ combination that acts as the wave function, so there are only three polarizations for a given direction - and one of them (the longitudinal) is forbidden, too. ;-) But the qualitative point that there are many polarizations is correct.
However, as emphasized repeatedly, you shouldn't imagine that a virtual photon is a real particle that can be counted. That's a reason why QGR's answer is pretty much irrelevant for your question because there is no operator counting virtual photons at all - so it makes no sense to ask whether it commutes with other operators. QGR may have thought about real photons but he hasn't answered your question, anyway.
By the way, static fields correspond to a vanishing frequency - because everything with a non-vanishing frequency will go like $\exp(i\omega t)$ or $\cos(\omega t)$. So if you want to describe the fields of electric sources and magnets as a collection of virtual photons, you must realize that the static nature of the field implies that the relevant fields will have the energy equal to zero. But the momentum is nonzero because the field depends on space - because of the sources. Such virtual photons are very far from being on-shell - they're very virtual, indeed. It is not too helpful to talk about virtual photons with particular frequencies and wavenumbers if there are electric sources in the middle of the region you want to describe. The Fourier analysis is only helpful for photons in a pretty much empty space.
But you could calculate the probabilities of various outcomes for a charged particle in an external electric or magnetic field, produced e.g. by many spinning electrons, using Feynman diagrams - where the virtual photons are the internal lines. The Feynman diagrams would be able to calculate the force acting on the probe particle. Some terms in the force wouldn't depend on the velocity - the electric forces - while others would depend on the velocity - the magnetic ones. These different terms would always come from the "same type" of virtual photons but all these photons depend on the sources of the field, so you would of course get different results for electric and magnetic fields.
All this stuff is confusing and really unnecessary. If you worry that quantum electrodynamics won't reproduce basic properties of electromagnetism - such as the difference between electricity and magnetism; or the difference between attractive and repulsive forces - then you shouldn't worry. It can be easily demonstrated that in the classical limit - e.g. for strong enough fields with a low enough frequency - the quantum electrodynamics (and the quantum field) directly reduces to the right classical limit, the classical electrodynamics (and the classical fields). Virtual photons are just a very helpful tool to study all kinds of processes similar to scattering. Their maths can be deduced from quantum fields - not the other way around - and these virtual photons don't happen to be useful to describe your kind of highly classical situations.
Best wishes Luboš
In QED, for transverse photons, the electric field doesn't commute with the photon number operator. Neither does the magnetic field. In fact, the electric and magnetic fields don't even commute with each other. To get a state with a fixed electric field — or at least with a small uncertainty in it in the quantum sense — we need a superposition of states with different numbers of photons. This is called a squeezed state in quantum optics. The smaller the uncertainty in the electric field, the larger the corresponding uncertainty in the magnetic field and vice versa.
Photons come with a transverse polarization. The electric field is parallel to it, while the magnetic field is perpendicular to both the polarization and the wave vector.
What about longitudinal photons then? In the $\xi$-gauge, we have to impose additional constraints (Lorenz gauge and Gauss constraints), making the actual physical state a coherent state with a definite value for the Fourier transform of the longitudinal component of the electric field, which is equated with the Fourier transform of the charge density divided by the wave number. This applies to electrostatics. Longitudinal photons do not contribute to the magnetic field.
What about magnetostatics then? Only transverse photons can contribute to the magnetic field, and the analysis involving photon number operators applies. This time, we have a special case of a squeezed state, namely a coherent state. We have to note though that the number of photons isn't conserved in time because of absorption and emission by the current source. This causes the coherent phase to kept stationary in time, instead of rotating.
Incidentally, unless a photon escapes into outer space and heads off to infinity without being absorbed by or interacting with any matter, then by the definition of a virtual photon as a photon propagator not contained in any of the external legs of a Feynman diagram, nearly all photons are virtual photons. And if a photon is detected in any way, it definitely has to be a virtual photon.