Relative Ljusternik-Schnirelmann category of index pairs and applications to critical point theory