The Casimir-Polder potential from an exact diagonalization of the Hamiltonian of two three-dimensional harmonic oscillators interacting with the electromagnetic field