Higher differentiability of solutions to a class of obstacle problems under non-standard growth conditions