Generation of relativistic electron (RE) beams during ultraintense laser pulse interaction with plasma targets is studied by collisional particle-in-cell (PIC) simulations. Strong magnetic field with transverse scale length of several local plasma skin depths, associated with RE currents propagation in the target, is generated by filamentation instability (FI) in collisional plasmas, inducing a great enhancement of the divergence of REs compared to that of collisionless cases. Such effect is increased with laser intensity and target charge state, suggesting that the RE divergence might be improved by using low-Z materials under appropriate laser intensities in future fast ignition experiments and in other applications of laser-driven electron beams.