Nonlinear rectification of the ocean circulation driven by random forcing, which simulates the effect of unresolved eddies, is studied in an idealized closed basin. The results are based on the analysis of randomly forced solutions and linear eigenmodes. Depending on the forcing strength, two rectification regimes are found: zonal jets and isolated gyres. It is shown that both regimes are due to nonlinear interactions of resonant basin modes. In the zonal-jet regime, these interactions involve complex interplay between resonant baroclinic modes and some secondary modes. Both Rhines' scaling for zonal jets and prediction of gyres based on the maximum entropy argument are not confirmed.