A self-consistent model for the elastic contact of rough surfaces