Structural and magnetic correlations in liquid oxygen: an ab initio molecular dynamics study