Well, he said it, but he was quoting an opponent, as the ad fails to mention. Here, watch.

New York Times:

The ad shows Mr. Obama saying, “If we keep talking about the economy, we’re going to lose.”

But the line, which is perhaps the spot’s most devastating moment, is also the one that seems to be the most taken out of context. In fact, at the time, Mr. Obama was referring to something that an aide to his then opponent, Senator John McCain of Arizona, had said in reference to the McCain campaign — not Mr. Obama, then or now.