VRS-NeRF: Visual Relocalization with Sparse Neural Radiance Field