A multicomponent density-functional theory is developed for the combined system of electrons and nuclei. We construct approximate functionals for the electron-nuclear correlation energy and illustrate the theory by explicit calculations for the H+2 molecular ion.