Heavy-quark bound states in potentials with the Bethe-Salpeter equation