From Jackson's "Classical Electrodynamics" third edition in Chapter 5 section 16 "Energy in the Magnetic Field". He talks about how "the creation of a steady-state configuration of current involves an initial transient period during which the currents and fields are brought from zero to the final values. For such time-varying fields there are induced elecromotive forces that cause the sources of current to do work. Since the energy in the field is by definition the total work done to establish it, we must consider these contributions".
Then he goes on to derive an expression for the magnetic field energy, which is identical to yours if there is a linear relationship between $\mathbf{B}$ and $\mathbf{H}$. If you're interested you can pick up a copy, I highly recommend it if you're interested in the theoretical side of electrodynamics/physics.