Quantum phases of atomic gases in optical lattices