Do electromagnetic fields gravitate? It's well known that electromagnetic fields contains energy but do they gravitate?
When we talk about the composition of the universe it's now accepted that the 74% is dark energy, the 22% is dark matter and then the remaining 4% is the rest of ordinary matter/energy that we can see or measure. Are the electromagnetic fields considered in this 4%?
 A: Partly this answer is just gathering together the comments above, though there are a couple of points that haven't been mentioned.
Firstly, as mentioned in the comments electromagnetic waves do gravitate and the links in the comments cover this well. In the early universe (for the first 47,000 years after the Big Bang) EM radiation was the dominant contribution to gravity, and as a result this era is known as the radiation-dominated era. However radiation dilutes more rapidly than matter as the universe expands, and for the last 13.7 billion - 74,000 years matter has outweighed (no pun intended) EM radiation. I can't find a figure for the current fraction of the critical density made up from radiation, but it's very small.
You asked about the effect of charge. In practise all large objects are approximately neutral so charge contributes little to their gravitational fields. However in principle charge has an effect but it probably isn't what you think.
For example the spacetime curvature around a stationary black hole is described by the Schwarzschild metric. If you now add charge to the black hole the curvature is described by the Reissner-Nordström metric. The charge decreases the curvature and indeed if you add enough charge you can make the event horizon disappear to leave a naked singularity.
A: It is tempting to say that radiation gravitates since we know that E=m*c^2 and and mass gravitates. Further, gravity starting with its inverse square law is a consequence of conservation of momentum according to Bertrand theorem(https://en.wikipedia.org/wiki/Bertrand%27s_theorem#:~:text=In%20classical%20mechanics%2C%20Bertrand's%20theorem,orbits%20are%20also%20closed%20orbits. ). We know that radiation has momentum too and does observes momentum conservation. Further, we know that Maxwell equations show that it is possible to regard radiation like a gas that has a pressure(https://en.wikipedia.org/wiki/Photon_gas ). So the conclusion is that radiation does gravitate but it also suffers an expansion pressure force like a gas, and it is the balance between these two forces that decides the final state of radiation in an unbound space.
