X-Ray spectra background fitting by projection onto convex sets