We propose a novel credit default model that takes into account the impact of macroeconomic information and contagion effect on the defaults of obligors. We use a set-valued Markov chain to model the default process, which is the set of all defaulted obligors in the group. We obtain analytic characterizations for the default process, and use them to derive pricing formulas in explicit forms for synthetic collateralized debt obligations (CDOs). Furthermore, we use market data to calibrate the model and conduct numerical studies on the tranche spreads of CDOs. We find evidence to support that systematic default risk coupled with default contagion could have the leading component of the total default risk.