Critical point index for vector functions and vector optimization