Interplay between magnetic interactions in spin-valve structures