We introduce an effective model for e(g) electrons to describe three-dimensional perovskite (La(1 - x)Sr(x)MnO(3) and La(1 - x)Ca(x)MnO(3)) manganites and study the magnetic and orbital order on a 4 × 4 × 4 cluster using correlated wavefunctions. The model includes the kinetic energy, and on-site Coulomb interactions for e(g) electrons, antiferromagnetic superexchange interaction between S = 3/2 core spins, and the coupling between e(g) electrons and Jahn-Teller modes. The model reproduces the experimentally observed magnetic order: (i) an A-type antiferromagnetic phase in the undoped insulator LaMnO(3), with alternating e(g) orbitals and with small Jahn-Teller distortions, changing to a conducting phase at 32 GPa pressure, and (ii) ferromagnetic order in one-eighth-doped La(7/8)Sr(1/8)MnO(3) and in quarter-doped La(3/4)Sr(1/4)MnO(3) compounds. For half-doped La(1/2)Ca(1/2)MnO(3) one finds a competition between a ferromagnetic conductor and the CE insulating phase; the latter is stabilized by the Jahn-Teller coupling being two times larger than for the strontium-doped compound. Altogether, there is a subtle balance between all Hamiltonian parameters and the phase diagram is quite sensitive to the precise values they take.