Direct and compound-nucleus reaction mechanisms in the Be7+Ni58 system at near-barrier energies