Emotions are affected by action and reaction, in a cyclical and continuous feedback fashion. There is no contradiction between saying that un/happiness is a choice and un/happiness is contagious; it's just that when you're in a group, there's more than one person choosing how to act, and some measure of one's reaction is involuntary. The more negative people are in your group, the harder you have to fight - i.e. the more times you'll have to consciously choose - to turn reactions more positively.
There are a lot of ambient factors that affect un/happiness though, particularly health, environment, stress etc. The more of these things that are getting you down, the more work it is to stay upbeat. The spiral you have to fight to keep out of is getting discouraged, and not changing those ambient factors any more.