Statistical mechanics of a two-dimensional system with long-range interactions