Role of surface plasmons in the optical interaction in metallic gratings with narrow slits