Mr. Biden and his top advisers made no effort to hide their disappointment about Iowa on Wednesday — and they plainly recognize that he must finish closer to the top in New Hampshire if he is to remain in contention by the time Super Tuesday rolls around early next month.

Speaking in Somersworth, N.H., on Wednesday morning, the former vice president demonstrated that he recognized his position is perilous.

“I am not going to sugarcoat it, we took a gut punch in Iowa,” Mr. Biden said. But then he offered a more confident message to those he said were already moving to “write off” his candidacy.

“I’m not going anywhere,” he said, adding: “I’m counting on New Hampshire. We’re going to come back.”

And he signaled that to do so, he is going to directly confront two of his rivals.

“Donald Trump is desperate to pin the socialist label of socialist, socialist, socialist on our party,” Mr. Biden said, alluding to Mr. Sanders, a self-avowed democratic socialist. He argued that every Democrat on the ballot “will have to carry the label” in November.

Similarly, Mr. Biden warned that elevating Mr. Buttigieg could hand Mr. Trump four more years.

“I have great respect for Mayor Pete and his service to this nation,” Mr. Biden said. “But I do believe it’s a risk, to be just straight up with you, for this party to nominate someone who’s never held an office higher than mayor of a town of 100,000 people in Indiana.”

William Shaheen, a longtime Democratic activist in New Hampshire who spent time with Mr. Biden Wednesday, said he was happy that “Joe has got his Irish up,” as he put it.