Using classical density functional theory, the structure of a molecular fluid around a cylindrical nanoparticle near a solid substrate is studied. The solvent-mediated force between the nanoparticle and the substrate is calculated in both the nematic and isotropic phases of the solvent. In the nematic phase, the force is short ranged and arises due to interaction between high-density regions near the substrate and nanoparticle. In the isotropic phase, the formation of a nematic bridge between the substrate and nanoparticle gives rise to an attractive force between them. The potential between the nanoparticle and substrate as a function of separation calculated numerically is compared to that calculated from the Derjaguin approximation. In the isotropic phase these are found to be in reasonable agreement at low separations, while the agreement is poorer in the nematic phase.