Density functional study of wetting by polymers. I. Effects of polymer length and surface potential