We consider multidimensional gravitational models with a nonlinear scalar curvature term and form fields in the action functional. In our scenario it is assumed that the higher dimensional spacetime undergoes a spontaneous compactification to a warped product manifold. Particular attention is paid to models with quadratic scalar curvature terms and a Freund-Rubin-like ansatz for solitonic form fields. It is shown that for certain parameter ranges the extra dimensions are stabilized. In particular, stabilization is possible for any sign of the internal space curvature, the bulk cosmological constant, and of the effective four-dimensional cosmological constant. Moreover, the effective cosmological constant can satisfy the observable limit on the dark energy density. Finally, we discuss the restrictions on the parameters of the considered nonlinear models and how they follow from the connection between the D-dimensional and the four-dimensional fundamental mass scales.