Lattice Yang-Mills theory at nonzero temperature and the confinement problem