Monte Carlo simulation of a two-dimensional dipolar lattice