A surface-induced transition in polymeric nematics