If my spell gets Defied, does it still count as being played?
No, if your spell is defied (countered), it is not considered to have been played.
According to Rule 412.1.b: "A card that is Countered is not considered to have been played."
Because the card never finishes the process of being played, it will not trigger "When you play..." abilities, and it does not count toward conditions that check if you have played a certain number of cards that turn.