Action principle for the Electromagnetism and Gravity Here is the formula for the stress energy tensor:
$$
    T_{\mu\nu} = - {2\over\sqrt{ |\det g| }}{\delta S_{EM}\over
            \delta g^{\mu\nu}}
$$
(This follows from varying the total action $S = S_H + S_{EM}$, where $S_H={c^4\over 16\pi G} \int R \sqrt{ |\det g_{\mu\nu}| } d^4 x$ is the Hilbert action and it gives the Einstein's equations, and $S_{EM}$ are other terms in the Lagrangian, that contribute to the right hand side of the Einstein's equations in form of the $T_{\mu\nu}$ above.) The Lagrangian of the electromagnetic field is:
$$
S_{EM1} = -\int {1\over 4\mu_0} F_{\alpha\beta} F^{\alpha\beta}
        \sqrt{ |\det g| } d^4 x
$$
and using the formula above, we get for the stress energy tensor:
$$
    T_{\mu\nu} = {1\over \mu_0} \left(
            F_{\mu\beta} F_\nu{}^\beta
            -{1\over 4} F_{\alpha\beta} F^{\alpha\beta}
            g_{\mu\nu} \right)
$$
which is the correct elmag. stress energy tensor. However, the interaction part of the elmag. Lagrangian is
$$
S_{EM2} = -\int j_\mu A^\mu \sqrt{ |\det g| } d^4 x
$$
and if we interpret this as a function of $g^{\mu\nu}$ it would also contribute to the stress energy tensor like this:
$$
\delta S_{EM2} = -\delta\int j_\mu A^\mu \sqrt{ |\det g| } d^4 x
  =-\int \delta (g^{\mu\nu} j_\mu A_\nu \sqrt{ |\det g| }) d^4 x =
$$
$$
  =-\int (\delta g^{\mu\nu}) (j_\mu \sqrt{ |\det g| })) A_\nu  d^4 x
$$
where the $j_\mu \sqrt{ |\det g| }$ is treated as the current density (and thus not depending on $g^{\mu\nu}$ when varying), however, clearly the stress energy tensor corresponding to this would be:
$$
T_{\mu\nu} = 2 j_\mu A_\nu
$$
(Possibly only the symmetric part contributes, because the antisymmetric part cancels with $g^{\mu\nu}$, so we would get $T_{\mu\nu} = j_\mu A_\nu + j_\nu A_\mu$.) In either case, such terms should then appear on the right hand side of the Einstein's equations. However, I don't think that this is correct.
Does anybody know what is wrong here?
 A: The comments by Jerry Schirmer tell you the main idea, but I would like to give them more explicitly, and in answer form. When you vary the action with respect to $A_\mu$, the metric variation does not give the unwanted term you mention. But if you vary with respect to $A^\mu$, you do get this term, and it should not appear on the right hand side of Einstein's equations, since we already know those equations from the A 1-form version of the variation.
But the equations of motion shouldn't care whether you choose to vary with respect to $A^\mu$ or with respect to $A_\mu$, you should get the same equations. Formally
$$\delta S = {\delta S\over \delta g_{\mu\nu}}\delta g_{\mu\nu} + {\delta S \over \delta A_\mu} \delta A_\mu $$
And the Einstein equations are the coefficients of $\delta g$, while the (vector potential non-vacuous) Maxwell equations are the coefficients of $\delta A$.
The variations in $A^{\mu},g_{\mu\nu}$ can be easily expressed in terms of the variations in $A_{\mu},g_{\mu\nu}$,
$$ \delta A_{\nu} = \delta A^{\mu} g_{\mu\nu} + A^{\mu}\delta g_{\mu\nu} $$
Which, when expressing the total variation of the action, linearly mixes up the Einstein and Maxwell parts:
$$ \delta S = ( {\delta S\over \delta g_{\mu\nu}} + {\delta S \over \delta A_{\mu}} A^{\nu})\delta g_{\mu\nu} + {\delta S\over\delta A_{\mu}} g_{\mu\nu} \delta A^{\nu} $$
Where the variational derivatives are all the old variational derivatives, with respect to the pair $g_{\mu\nu},A_{\mu}$ holding the other fixed. These linear combinations give the new variations. It is trivial to see that the new equations of motion are satisfied if and only if the old ones are, so nothing has changed.
The new Maxwell equations are, after multiplying by the inverse metric, the same as the old ones. But the new Einstein equation has an extra source term in it:
$$ {\delta S \over \delta A_\mu} A^{\nu} $$
This extra source term is obviously zero, by the Maxwell equations, but $\delta S \over \delta A_\mu$ includes the term $J^\mu$, so the term that was bothering you appears here. This variation gives a right hand side of Einstein's equations which includes an extra stress which includes the source term, in the form of the Maxwell equation times the vector potential
$$( D_{\mu} F^{\mu\nu} - J^{\nu}) A^\mu $$
But now it is obvious that the stress contribution vanishes (as it always was, because this is just a variation with respect to different variables of the same action).
On the density variations
Jon's answer calculates an additional term from varying $\sqrt{g}$, but this term is not present. This is for the reason explained in the answer to this question: Lagrangian for Relativistic Dust derivation questions .
When you vary the metric with EM and, say, a charged dust source, you hold $J\sqrt{g}$ fixed. This is for the same reason that the momentum density is held fixed, you keep the number of worldlines constant when you vary g, so that the conserved currents and charges are preserved under metric variations.
A: I think that, in the expression
$$
S_{EM2} = -\int j_\mu A^\mu \sqrt{ -g } d^4 x
$$
you have to derive also the determinant. If you do so you will get
$$
  \frac{1}{2}\sqrt{-g}(j_\nu A_\mu+j_\mu A_\nu) \delta g^{\mu\nu}
  -\frac{1}{2}g_{\mu\nu}\sqrt{-g}j\cdot A\delta g^{\mu\nu}.
$$
So, you will get
$$
  T^{(2)}_{\mu\nu}=-\frac{2}{\sqrt{-g}}\frac{\delta S_{EM2}}{\delta g^{\mu\nu}}
  =-(j_\nu A_\mu+j_\mu A_\nu)+g_{\mu\nu}j\cdot A.
$$
This should be the right result.
A: Actually your initial formula is wrong: the 
$\delta(S_{EM})/\delta(g(u,v))$ should be
$\delta(L_{EM}/\delta(g(u,v))$,
where $L$ (the Lagrangian) is the thing that is integrated over space to get the action $S$.
It's an apple and oranges thing: the action is the integral of the Lagrangian, $\delta$ (action) remains a number, not a space function as required.
Interestingly, Wald's book and MTW book both have this wrong, just like you do, so it is understandable.  If you look at other sources on Lagrangian field theory, or even the Wikipedia article on the stress-energy tensor under Hilbert stress-energy tensor, they have it correct, taking delta of the density function L rather than the integral of it, S, when defining the stress-energy tensor (which is a space function).
This has no effect on your working the problem, but it is remarkable that these two widely-used textbooks on GR would write this thing which makes no sense and everyone just accepts it and proceeds as if it made sense.  Students are very accepting people.
