This Great Graphic comes from Sober Look blog. It shows how well the Conference Board's measure of consumer confidence tracked the S&P 500. However, more recently there has been notable divergence.
It is easy to slip into a causal argument whereby increased confidence "causes" people to buy stocks. Yet we know that for most of the past several quarters money has been leaving US equity funds, which is the primary way retail invests (think 401k plans).
It is clearer what has been happening most recently. The fiscal cliff and coupled with the end of the payroll savings tax holiday took a toll just as the Federal Reserve more than doubled the amount of long term assets it is buying every month. In addition, the rally in US shares is also part of a global reallocation, which is also lifting most equity markets around the world.