The baryon fractions in clusters of galaxies