Antiferromagnetic phase transition in a nonequilibrium lattice of Rydberg atoms