We found the effect of a hidden photoalignment of a dye-doped nematic liquid crystal (LC) on a nonphotosensitive polymer surface after polarized irradiation of the cell in the isotropic phase. We observed that irradiation resulted in a uniform planar orientation of the LC after cooling to the mesophase. The direction of a light-induced easy axis on the polymer can he either parallel or perpendicular to the polarization of the incident light, depending on the light intensity. We attribute this behavior to two mechanisms of photoalignment: light-induced adsorption of dye molecules on the substrate, and anisotropic desorption in a previously adsorbed dye layer. The experimental results on photoalignment of a LC on a thin dye film confirm our model.