Numerical simulations of radiative processes in magnetized compact sources such as hot accretion disks around black holes, relativistic jets in active galaxies and gamma-ray bursts are complicated because the particle and photon distributions span many orders of magnitude in energy, they also strongly depend on each other, the radiative processes behave significantly differently depending on the energy regime, and finally due to the enormous difference in the time-scales of the processes. We have developed a novel computer code for the time-dependent simulations that overcomes these problems. The processes taken into account are Compton scattering, electron-positron pair production and annihilation, Coulomb scattering as well as synchrotron emission and absorption. No approximation has been made on the corresponding rates. For the first time, we solve coupled integro-differential kinetic equations for photons and electrons/positrons without any limitations on the photon and lepton energies. A numerical scheme is proposed to guarantee energy conservation when dealing with synchrotron processes in electron and photon equations. We apply the code to model nonthermal pair cascades in the blackbody radiation field, to study the synchrotron self-absorption as particle thermalization mechanism, and to simulate time evolution of stochastically heated pairs and corresponding synchrotron self-Compton photon spectra which might be responsible for the prompt emission of gamma-ray bursts. Good agreement with previous works is found in the parameter regimes where comparison is feasible, with the differences attributable to our improved treatment of the microphysics.Vurm & Poutanen diative transport. Various approximations invoked to simplify the treatment of radiative processes at the same time limit the range of their applicability. One commonly employed approximation concerns Compton scattering, which is assumed to take place in the Thomson regime (e.g. Ghisellini et al. 1998, hereafter GHS98) and is accounted for by a simple cooling term in the electron equation. This sets two restrictions that the photon energy in the electron rest frame is smaller than the electron rest mass and the average photon energy is much lower than the electron kinetic energy. Otherwise all photons would not contribute to electron cooling, the higher energy ones being downscattered via Compton scattering. This means that one is unable to treat cases when Comptonization approaches saturation, which may be relevant at high compactnesses, and to study electron heating by external radiation. Other works account for Klein-Nishina corrections to the electron cooling rate, but still neglect the diffusive nature of the process when electron and photon energies are comparable (Coppi 1992;Moderski et al. 2005;Pe'er & Waxman 2005), which works towards establishing an equilibrium Maxwellian distribution. Another useful approximation, when the integral terms describing Compton scattering are accounted for, is to consider ultrarelativistic electrons and very l...