Capita has swung to a profit as the outsourcing giant said it is “on track” with cost-cutting plans.