An increasing amount of observational evidence supports the notion that there are two modes of star formation: a quiescent mode in disk-like galaxies, and a starburst mode, which is generally interpreted as driven by merging. Using a semi-analytic model of galaxy formation, we derive the relative contribution to the cosmic star formation rate density of quiescently starforming and starburst galaxies, predicted under the assumption that starburst events are triggered by galaxy encounters (merging and fly-by kind) during their merging histories. We show that, within this framework, quiescently starforming galaxies dominate the cosmic star formation rate density at all redshifts. The contribution of the burst-dominated starforming galaxies increases with redshift, rising from <5% at low redshift (z<0.1) to ~20% at z>5. We estimated that the fraction of the final (z=0) galaxy stellar mass which is formed through the burst component of star formation is ~10% for 10^10 M_odot<M_*<10^11.5 M_odot. Starburst galaxies, selected according to their distance from the galaxy main sequence, account for ~10% of the star formation rate density in the redshift interval 1.5<z<2.5, i.e. at the cosmic peak of the star formation activity.