Within the Rabi quantum model, it has been shown theoretically that a two-level atom ultrastrongly coupled to an electromagnetic field generates or absorbs photons. Photons can be generated if the field is initially in the vacuum state. Under certain initial states of the atom + field system, the absorption of photons is possible in the field mode in the ultrastrong atom-field coupling regime. If the atom is initially in the ground (unexcited) state and the field is in the vacuum state, photons can be generated under resonance condition omega(a) approximate to omega(f) or xi equivalent to omega(a)/omega(f) approximate to 1, where omega(a) and omega(f) are the atomic transition and field frequencies, respectively, in the ultrastrong coupling regime. At the negative detuning when xi << 1 or omega(a) << omega(f), Rabi oscillations of the average number of photons < n<^>> t with 0 <=< n<^>> t <= nmax >> 1 are observed in the case of the ultrastrong coupling with the atom-field coupling constant g~equivalent to|g|/omega f similar to 1; in this case, the population of the excited atomic state is P-e(t) approximate to 0.5. At a large positive detuning when xi >> 1, photons are not generated, i.e., < n<^>>approximate to 0, and the atom remains in the initial state, i.e., P-e(t) approximate to 0. The statistics of photons in the generation regime is nearly chaotic: the variance of photons is much larger than the level of the coherent field state (i.e., is super-Poisson). Field photons are absorbed without the excitation of the atom in the ultrastrong coupling regime in the case of the coherent initial state of the field (< n<^>(t=0 >>0) for certain positive detuning values. In this case, the field becomes sub-Poisson.