Reducing activity-induced variations in a radial-velocity time series of the Sun as a star