The photoevaporation of discs around young stars in massive clusters