Critical points index for vector functions and vector optimization