Generation of poloidal electric field in a neutral-beam heated tokamak