Three-Dimensional Orientational Order in the Bulk and on the Surface of Polymer Films and Its Effect on Liquid-Crystal Alignment