Context : The prompt emissions of gamma-ray bursts ( GRBs ) are seeded by radiating ultrarelativistic electrons . Kinetic energy dominated internal shocks propagating through a jet launched by a stellar implosion , are expected to dually amplify the magnetic field and accelerate electrons . Aims : We explore the effects of density asymmetry and of a quasi-parallel magnetic field on the collision of two plasma clouds . Methods : A two-dimensional relativistic particle-in-cell ( PIC ) simulation models the collision with 0.9c of two plasma clouds , in the presence of a quasi-parallel magnetic field . The cloud density ratio is 10 . The densities of ions and electrons and the temperature of 131 keV are equal in each cloud , and the mass ratio is 250 . The peak Lorentz factor of the electrons is determined , along with the orientation and the strength of the magnetic field at the cloud collision boundary . Results : The magnetic field component orthogonal to the initial plasma flow direction is amplified to values that exceed those expected from the shock compression by over an order of magnitude . The forming shock is quasi-perpendicular due to this amplification , caused by a current sheet which develops in response to the differing deflection of the upstream electrons and ions incident on the magnetised shock transition layer . The electron deflection implies a charge separation of the upstream electrons and ions ; the resulting electric field drags the electrons through the magnetic field , whereupon they acquire a relativistic mass comparable to that of the ions . We demonstrate how a magnetic field structure resembling the cross section of a flux tube grows self-consistently in the current sheet of the shock transition layer . Plasma filamentation develops behind the shock front , as well as signatures of orthogonal magnetic field striping , indicative of the filamentation instability . These magnetic fields convect away from the shock boundary and their energy density exceeds by far the thermal pressure of the plasma . Localized magnetic bubbles form . Conclusions : Energy equipartition between the ion , electron and magnetic energy is obtained at the shock transition layer . The electronic radiation can provide a seed photon population that can be energized by secondary processes ( e.g . inverse Compton ) .