Exact solution of the extended Hubbard model in the atomic limit on the Bethe Lattice