See, for example:
Griffiths, Introduction to Electrodynamics (1999), section 7.2.4
Vanderlinde, Classical Electrodynamic Theory (2005), section 4.1.4
Jackson, Classical Electrodynamics (1999), section 5.16
The ##B^2##-term might be defined as the magnetic energy term, but it gives the correct...