President Reagan and Senate Democrats were at an impasse last night on plans to provide $14 million in aid to rebels fighting Nicaragua's Sandinista government, throwing into doubt Reagan's request for the aid as Congress prepares to vote on it today.

After more than eight hours of bargaining at the White House, Reagan and his Republican Senate allies appeared to have narrowed differences with the Democrats but remained divided on major issues, including the U.S. role in peace negotiations.

A renewed effort to reconcile positions in the Republican-controlled Senate may occur this morning. White House officials have said they consider Senate agreement crucial to winning any aid for the rebels, known as "contras."

Reagan, who has made a rapid series of concessions in recent weeks trying to avoid defeat in Congress on a major foreign policy initiative, faces stiffer opposition in the Democratic-controlled House.

"We're still not there. We don't have a consensus. We don't have an agreement," Senate Majority Leader Robert J. Dole (R-Kan.) said after the marathon session in the White House Cabinet room. The meeting produced general agreement on providing $14 million in "humanitarian" assistance to the Nicaraguan rebels, but differences persisted on other issues.

Both sides said the major stumbling block is a Democratic proposal that the money be linked to resumption of direct talks between the United States and the Sandinistas. The United States broke off the talks earlier this year.

A senior White House official who spoke on condition that he not be identified told reporters that, while Reagan does not object "in principle" to such talks, the president insisted yesterday that primary emphasis be placed on talks between the Sandinistas and the rebels, which the Sandinistas have rejected.

"The priorities are different, very different" between Reagan and the Senate Democrats, the official said.

A second disagreement is about how the money should be disbursed. The administration and Republican senators said they want to funnel the aid through the Central Intelligence Agency, which handled it before Congress cut off aid to the rebels last year.

The White House proposed yesterday that Congress and the National Security Council be given strict oversight of the CIA expenditures, according to Senate Select Committee on Intelligence Chairman David F. Durenburger (R-Minn.).

But Democrats said they want the money to come from existing State Department funds. The White House countered that this would pose legal problems because the State Department would be dealing with a foreign entity "that is not the sovereign government" of Nicaragua.

Democrats also called for a cease-fire between the Sandinistas and the rebels but stopped short of requiring negotiations between them, as the administration seeks.

The White House official said another point on which Reagan disagrees is the cease-fire. He said the president feels that the Democratic proposal includes no "safeguards" to prevent the Sandinistas from conducting an arms buildup during the cease-fire. Reagan wants some kind of mechanism to monitor the cease-fire to ensure that this does not happen, the official said.

Senate Minority Leader Robert C. Byrd (D-W.Va.), who sources said struggled to keep Democrats at the bargaining table during the lengthy talks, said later that he is "upbeat" about prospects for a compromise today.

Sen. Christopher J. Dodd (D-Conn.), who also participated in the discussions, said "I have my doubts" whether the differences can be bridged before today's scheduled vote.

The senior White House official emphasized that the differences are major ones of "purpose" between the president and the Senate Democrats.

The official said Reagan wants to bring about "internal reconciliation" between the Sandinistas and the rebels, while Democrats are seeking direct talks between the United States and Nicaragua.

He also said there are major, related differences on the rebels' role, which he claimed are "obscured" in the Democrats' plan, without a diplomatic role or legal standing.

The official said Reagan has "gone quite far" in compromising on his original plan.

"I really don't think the Democrats want the president to lose this one," Dole said. "The president doesn't want to lose, but he doesn't want to give up the store."

Under a process set in motion earlier, both chambers of Congress are scheduled to vote today on the issue.

While efforts to reach a compromise may resume today in the Senate, alternatives in the House appear to be set. The first House vote is to be on Reagan's original request for $14 million in military aid to the contras. That is expected to fail.

The next vote is to be on a Democratic alternative providing $10 million in "humanitarian" aid for Nicaraguan refugees through international organizations and $4 million to Mexico, Panama, Columbia and Venezuela to enforce any settlement emerging as a result of their Contadora peace process. It would prohibit direct assistance to the contras.

A third alternative, unveiled yesterday by House Minority Leader Robert H. Michel (R-Ill.), would provide $14 million in "humanitarian" aid to the rebels through the Agency for International Development.

The lengthy negotiating session at the White House came as Reagan strove to avoid a major political loss this week in his long quest to aid the Nicaraguan insurgents. His original proposal for military aid was modified earlier this month so that weapons would be provided only after a period of church-mediated negotiations with the Sandinistas.

The president then abandoned that approach and is now bargaining for only "humanitarian" aid through the rest of fiscal 1985, which ends Sept. 30. Some differences remain on what supplies would be allowed under this approach, but the senior official said last night that there were no discussions about "lethal" aid to the contras for the rest of this year.

White House officials said they realize that Reagan faces an uphill House fight but hope that, by compromising with the Senate, some aid to the contras would be approved in a conference agreement.

Also yesterday, Secretary of State George P. Shultz warned that abandoning the contras would be "a shameful betrayal -- a betrayal not only of brave men and women but of our highest ideas and the national security of the United States."

"To cut off support now for the democratic resistance in Nicaragua would be to turn our backs on a crucial opportunity for peace," he told the Indianapolis Economic Club.

"I agree to those who say that this could be the most important moment in Congress since 1947. Then, the Congress supported President Harry S Truman's determination to stand up to the expansion of Soviet imperialism. Tomorrow, Congress will choose whether to support the president in his determination to stop Soviet encroachment right here in our hemisphere," he said.