Thermal contact formulation based on the mortar method