A complementarity formulation to study lubricated contact problems in the presence of cavitation