Evolutionary dynamics of cancer cell populations under immune selection pressure and optimal control of chemotherapy