Spacecraft and interplanetary contributions to the magnetic environment on-board LISA Pathfinder