Jahn-Teller effect and stability of the charge-ordered state in La1-xCaxMnO3 (0.5 <= x <= 0.9) manganites