Theoretical study of magnetic impurities in small metallic clusters