Awaclus is technically correct that a card is an Attack if it has the Attack type. That's not really useful for discussion though. We can talk about what cards should be labelled an Attack. If what it does to other players generally hurts them, it should be labelled an Attack.
The interactions between players in Dominion are too complex to say that doing thing X hurts your opponent or doesn't hurt your opponent; any gainer can hurt my opponent when I use it to gain the last Village (any card with +$ or +buy too for the same reason), any trasher can hurt my opponent when I use it to trash Silvers right before he plays his Rogue. Indirectly, any cards with +2 or more cards or +2 or more actions can also hurt my opponent, because they're helping me play more Actions that hurt my opponent. I guess that you could even say that Victory cards should be Attack cards, because they give me more points, which lets me end the game in a victory, which means my opponents lose, which obviously hurts them.
Therefore, I'm suggesting that it should be labeled an Attack if you want Moat, Urchin, Squire and other cards to work with it. There are two different reasons why you would or would not want your card to interact with Moat etc:
1) It feels or doesn't feel intuitive — if a careless player is likely to read (or experience) what the card does and buy a Moat as a way to defend against it, then it's more intuitive to make it an Attack card (and if not, then not). This is true for all official Attack cards, also definitely true for Possession, and to a lesser extent also true for Masquerade. I think it is also true for a card that hands out Curses for everyone. I don't think it's
necessarily true for a card that hands out Rats for everyone — free Rats, that's awesome, normally I would have to pay $4 for it and apparently the designer of the game has intended for me to buy it at that cost anyway. We know that it actually does hurt you to get a Rats in most situations, but Lord Bottington, for example, likes them very much, and many new players haven't realized that a cantrip doesn't actually do anything useful on its own. There are also obvious reasons why it could be seen as a bad thing to get a free Rats. I'm pretty sure that some people will find it confusing if this is an Attack, and others will find it confusing if this isn't an Attack. I think it's better to make it an Attack in these kinds of situations, because when people find an Attack confusing in this way, the reaction is like "oh well, this is weird, why's this an Attack?", and then they'll brush it off and not care about it, but when people find a non-Attack card confusing in this way, the reaction is like "why doesn't Goko let me reveal this Moat that I already bought just for this purpose, Dominion sucks".
2) Interacting or not interacting with said cards is a key part of the functionality of the card. This could be true for the following card, for instance:
Flare
$2 Action
+1 Card
+1 Action
Each player reveals his hand and discards all the Reaction cards in it.
The purpose of this card is to get rid of those Reactions in your opponents' hands, take a look at those hands while you're at it, and activate your own Tunnels (hey, that's more flavorful than I even intended!). It wouldn't work if it was an Attack, because then it couldn't get rid of the Reactions. Masquerade has to be a plain Action because interacting with Moat would be confusing. Possession has to be a plain Action because interacting with Moat would make it completely useless. I don't think there's any particular reason why "everyone gains a Rats" shouldn't be an Attack for technical reasons.