A unified interface constitutive law for the study of fracture and contact problems in heterogeneous materials