Probing the diamagnetic term in light–matter interaction