The Fokker-Planck equation is one of the fundamental equations in nonequilibrium statistical mechanics, and this equation is known to be derived from the Wasserstein gradient flow equation with a free energy. This gradient flow equation describes relaxation processes and is formulated on a Riemannian manifold. Meanwhile contact Hamiltonian systems are also known to describe relaxation processes. Hence a relation between these two equations is expected to be clarified, which gives a solid foundation in geometric statistical mechanics. In this paper a class of contact Hamiltonian systems is derived from a class of the Fokker-Planck equations on a Riemannian manifold. In the course of the derivation, the Fokker-Planck equation is shown to be written as a diffusion equation with a weighted Laplacian without any approximation, which enables to employ a theory of eigenvalue problems.