Competition of superconductivity and antiferromagnetism in a d-wave vortex lattice