Spin dynamics in the optical cycle of single nitrogen-vacancy centres in diamond