The White House yesterday defended the legality of broad contacts between a member of the National Security Council staff and rebels fighting the Nicaraguan government, and President Reagan promised to work closely with Congress to make sure that the law is respected.

Various current and former government and rebel officials confirmed that a Marine officer on the NSC staff has played a key role in formation and implementation of U.S. policy in Central America over the last three years.

The officer has traveled frequently in the region and became a focal point in the last year for communication between the administration and the counterrevolutionaries, known as contras, who are battling the leftist Sandinista government of Nicaragua. He is considered a forceful advocate for a harder U.S. stance against a perceived spread of Soviet influence in the region.

The New York Times reported yesterday that the officer had exercised "tactical influence" on contra military operations, directed prospective financial donors to the rebels and otherwise helped organize and coordinate their efforts.

The Times said that he assumed more such duties when the Central Intelligence Agency withdrew last year in accordance with legislation passed then and that he was virtually running the contra program.

At the request of White House spokesman Larry Speakes, The Times and The Washington Post have withheld the officer's name. Speakes said last night that the officer and administration officials were concerned about his safety.

Rep. George E. Brown Jr. (D-Calif.), a member of the Permanent Select Committee on Intelligence, said in an interview that he is concerned that the officer's activities may have violated the new legislation banning direct and indirect aid to the contras by any intelligence arm of the government.

"It appears on the surface that the NSC is attempting to circumvent the law," Brown said.

"The intent of Congress was clear that all direct involvement with the contras was to be cut off . . . all intelligence-related matters go through the NSC; the question is whether it's considered an intelligence activity.

"I'm going to ask for very close scrutiny by the intelligence committee and, if there is any evidence, I will ask for hearings," Brown said.

Reagan was questioned about NSC activity as he signed into law the foreign aid authorization bill for two fiscal years, which provides $27 million in "nonlethal" aid to the contras.

"We're not violating any laws," Reagan said. In a statement later, the president said he would "continue to work with Congress to carry out the program as effectively as possible and take care that the law be faithfully executed."

Administration officials did not deny reports about the substance of the officer's activities but bridled at the suggestion that he runs the contras. One called the charges "a witch hunt" and asserted, "The operation is not being run out of the NSC."

Speakes said, "Contacts have been made from time to time with the contras for the purpose of receiving information." He added, "No member of the NSC staff has at any time acted in violation of either the spirit or the letter" of the law.

The officer declined to be interviewed.

Senate Foreign Relations Committee Chairman Richard G. Lugar (R-Ind.) said the NSC was "carrying out the president's policy . . . . I knew essentially what the administration was doing, and I approved of it."

Edgar Chamorro, a former director of the largest rebel force, the Nicaraguan Democratic Force (FDN), said in an interview that the officer went to FDN headquarters in Honduras in May 1984, just before Congress voted to end direct U.S. aid to the rebels, to reassure them of continued Reagan administration backing.

"They were very sensitive to us saying we knew they would abandon us sooner or later," Chamorro said. "When the CIA withdrew, he was the person that was left over as the main overseer, like a transition . . . . We were told it was very important that he was there to tell us we would not be abandoned."

Chamorro said the officer and a CIA agent had assured the rebels that "the planning of the operations would continue very close to the NSC."

Bosco Matamoros, FDN's spokesman here, said the group had contacted the officer with details of its March 3 unity proclamation in San Jose, Costa Rica, and had frequently talked with him and other administration officials about various subjects.

"It's ridiculous to say anyone in Washington conducts our military operations," Matamoros said. "Our tactics are decided by our field commanders."

Senate Select Intelligence Committee Chairman David F. Durenberger (R-Minn.) said he was unaware of any unlawful activity by the officer.

He said the officer had apparently moved from providing facts and implementing policy to "letting his feelings influence where he's going to put his time and effort in production of facts and implementation of policy."

The officer and a fellow NSC staff member had briefed committee members on Nicaragua, and the officer backed up national security affairs adviser Robert C. McFarlane in lobbying on Capitol Hill to push a contra aid bill through the Senate last spring, Durenberger said. He called the officer "McFarlane's boy."

Retired Army major general John K. Singlaub, who coordinates a large number of private efforts to aid the contras, told Associated Press in June 1984 that the officer had advised him on fund-raising for the rebels.

Singlaub said he now tells the officer, " 'This is what I'm going to do. If it's a dumb idea, send me a signal,' " and added that he had never received such a signal.