Unfortunately, it's not particularly clear if a magnetic field satisfies the defintion of mass as a "quantity of material" that you offered.
You oferred this statement as "obvious", but never provided a source.
It's even less clear if the gravitational field contributes to "the quantity of material". That defintion of mass is very vague, unfortunately.
I can say that it is impossible to localize the energy in the "gravitational field". See for instance
http://en.wikipedia.org/wiki/Mass_in_general_relativity or the original source in Misner, Thorne, Wheeler, "Gravitation".
(The wikipedia source, which I should probably mention that I wrote, is not peer reviewed, only wikipedian reviewed, but the orignal source, MTW's "gravitation", is peer reviewed. Unfortunately, MTW isn't as accessible as the Wikipedia article).
Here's a quote from the Wiki article in question:
Unfortunately, energy conservation in general relativity turns out to be much less straightforward than it is in other theories of physics. In other classical theories, such as Newtonian gravity, electromagnetism, and hydrodynamics, it is possible to assign a definite value of energy density to fields. For instance, the energy density of an electric field E can be considered to be 1/2 ε0 E2.
This is not the case in general relativity. It turns out to be impossible in general to assign a definite location to "gravitational energy". (Misner et al, 1973 chapter 20 section 4).
If one adopts one of the usual defintions for mass in special relativity of
mass^2 = E^2 - p^2 (where E, p and m are in geometric units) or
mass^2 = (E^2 - (pc)^2) / c^2
our inability to localize the energy of the gravitational field is directly equivalent to saying that we can't localize the "mass" of the graviational field. (This is of course the so-called "invariant mass" of SR.)
Being unable to localize it does not mean, however, that gravitational binding energy does not affect the mass of a system.
For instance, if we assume that mass means, not "quantity of material", or even the "invariant mass" of SR, but rather "ADM mass" of GR, we can say the ADM mass of a pair of orbiting bodies that are close to each other (but well away from everything else, so that the system is isolated and the ADM mass concept is applicable) is not the same as the sum of the ADM masses of the same pair of bodies when they are separated and each body is an isolated system.
In the Newtonian limit, we can even say that the difference between the ADM mass of the system of two bodies and the sum of the ADM mass of each body "in isolation" is equal to the Newtonian gravitational binding energy of the system. (This is also mentioned in the Wiki article).