Polaron formation for nonlocal electron-phonon coupling: A variational wave-function study