A formulation for frictionless contact problems using a weak form introduced by Nitsche