Formulation and approximation of quasistatic frictional contact