In a detailed microscopic model of a system of particles, we can distinguish energy of the microscopic EM field (EM energy), and the other energy (due to mass and kinetic energy of massive particles).
But it is convenient, even in this microscopic setting, to talk about the EM energy stored near the particles making up the body as if it belongs to that body itself (thus putting the idea of EM field as a separate carrier of energy aside).
It is convenient and not necessary here, because we can always state which part is which. This translates even to Einstein's formula; we can split it into two formulae:
$$
E_{em} = m_{em} c^2
$$
for EM energy and corresponding EM mass, and
$$
E_{non-em} = m_{non-em}c^2
$$
for non-EM energy and corresponding non-EM mass.
In macroscopic considerations, identifying the two contributions is harder, because we can't easily determine via experiments how big each component is; what is measurable is total inertial mass, and thus total internal energy obeying $E=mc^2$. How much comes from EM energy and how much from other kinds of energy is not easily measurable.
I guess part of your question is, why does EM energy contribute to this Einstein formula for total inertial mass and thus why does EM energy influence inertial mass of the body?
Einstein provided several derivations for this effect of EM energy, based on theory of relativity. Application to other kinds of energy is then natural extension/generalization of those results.
But for EM energy, there is also another, more direct way that reveals the mechanism of how interaction energy influences effective inertial mass. This was discovered probably by Lorentz and Abraham and possibly others sometime near the beginning of 20th century, when they studied net EM forces acting on simple configurations of charge such as a charged sphere due to their own constituents. They realized that whenever a system made of many charged particles is accelerating, it experiences generally non-zero net "self-force" due to charged particles forming the body. This violates Newton's third law, but it is a correct conclusion of the EM theory.
This "self-force" can be expanded into an infinite series with terms proportional to increasing order of time derivatives of velocity. The first term is proportional to acceleration, and may be called self-induction force, since it is responsible for the phenomenon of self-induction in inductors:
$$
\mathbf F_{self-induction} = k\mathbf a
$$
where the constant of proportionality $k$ turns out to be $-U/c^2$ where $U$ is the Coulomb interaction energy of the particles forming the system. If you're wondering how can there be net self-force, it is because of finite propagation of retarded EM fields and accelerated motion which creates mismatch in times different elementary retarded fields reach the other parts of the body, thus disturbing the perfect cancellation that occurs in rectilinear motions.
If the system is made of charged particles of the same sign, $U$ is positive, and the self-induction force has direction opposite to that that of the acceleration. Self-induction of charged body thus increases its effective mass. This is the same mechanism that is causing great inertia of mobile charge carriers in inductors (the inertia due to electrons having some rest mass being negligible).
If $U$ is negative, the self-induction force is proportional to acceleration and pointing in the same direction. This causes decrease in effective mass of the body.
For more on this, look for Lorentz's book Theory of electrons, his original papers as well as those of Abraham. A readable discussion of EM mass is also in Feynman's lectures on physics.