  We introduce an effective model for $e_g$ electrons to describe
quasi-two-dimensional layered La$_{2-x}$Sr$_{x}$NiO$_4$ nickelates and study it
using correlated wave functions on $8 \times 8 $ and $6 \times 6 $ clusters.
The effective Hamiltonian includes the kinetic energy, on-site Coulomb
interactions for $e_g$ electrons (intraorbital $U$ and Hund's exchange $J_H$)
and the coupling between $e_g$ electrons and Jahn-Teller distortions (static
modes). The experimental ground state phases with inhomogeneous charge, spin
and orbital order at the dopings $x=1/3$ and $x=1/2$ are reproduced very well
by the model. Although the Jahn-Teller distortions are weak, we show that they
play a crucial role and stabilize the observed cooperative charge, magnetic and
orbital order in form of a diagonal stripe phase at $x=1/3$ doping and a
checkerboard phase at $x=1/2$ doping.
