The efficiency of galaxy formation in clusters