A theoretical study of the mass-temperature relation for clusters of galaxies