Having played in just three tournaments this year, Federer said he was pulling out of the Madrid Masters after suffering a back problem in practice.