Let X be a compact nonsingular real algebraic variety. We prove that if a continuous map from X into the unit p-sphere is homotopic to a continuous rational map, then, under certain assumptions, it can be approximated in the compact-open topology by continuous rational maps. As a byproduct, we also obtain some results on approximation of smooth submanifolds by nonsingular subvarieties.