Magnetoelectric phase diagrams of the rare-earth (R) Mn perovskites RMnO3 are theoretically studied by focusing on crucial roles of the symmetric magnetostriction or the Peierls-type spin-phonon coupling through extending our previous work [M. Mochizuki et al., Phys. Rev. Lett. 105, 037205 (2010)]. We first construct a microscopic classical Heisenberg model for RMnO3 including the frustrated spin exchanges, single-ion anisotropy, and Dzyaloshinskii-Moriya interaction. We also incorporate the lattice degree of freedom coupled to the Mn spins via the Peierls-type magnetostriction. By analyzing this model using the replica-exchange Monte-Carlo technique, we reproduce the entire phase diagram of RMnO3 in the plane of temperature and magnitude of the orthorhombic lattice distortion. Surprisingly it is found that in the ab-plane spiral spin phase, the (S.S)-type magnetostriction plays an important role for the ferroelectric order with polarization P//a whose contribution is comparable to or larger than the contribution from the (SxS)-type magnetostriction, whereas in the bc-plane spiral phase, the ferroelectric order with P//c is purely of (SxS) origin. This explains much larger P in the ab-plane spiral phase than the bc-plane spiral phase as observed experimentally, and gives a clue how to enhance the magnetoelectric coupling in the spin-spiral-based multiferroics. We also predict a noncollinear deformation of the E-type spin structure resulting in the finite (SxS) contribution to the ferroelectric order with P//a, and a wide coexisting regime of the commensurate E and incommensurate spiral states, which resolve several experimental puzzles.