Quantum magnetic dynamics of polarized light in arrays of microcavities