Word symmetric functions and the Redfield-Pólya theorem