President Reagan yesterday directly contradicted the Justice Department's position on affirmative action, perhaps inadvertently, by saying that he approved of voluntary plans that give hiring preference to women and minorities.

William Bradford Reynolds, head of the Civil Rights Division, has said in recent interviews and in testimony before Congress that he believes it is illegal and unconstitutional to give preference to any group of people.

"By elevating the rights of groups over the rights of individuals, racial preferences . . . are at war with the American ideal of equal opportunity for each person to achieve whatever his or her industry and talents warrant," he told a congressional committee.

"This administration is firmly committed to the view that the Constitution and laws protect the rights of every person . . . to pursue his or her goals in an environment of racial and sexual neutrality."

Reynolds has also said he is looking for an opportunity to bring the issue before the Supreme Court and is hoping for an opinion that would ban such practices in private industry and in state and local governments.

Such a ruling would reverse a 1979 Supreme Court decision rejecting the challenge by Brian Weber, a white factory worker, to a special black training program at a Louisiana plant. In a 5 to 2 decision, the court upheld a voluntary union-management agreement for preferential hiring and promotions for black workers.

Reagan said he was not familiar with the Weber decision, but added, "This is something that simply allows the training and bringing up so that more opportunities are there for them in voluntary agreement between the union and the management. I can't see any fault with that. I'm for that."

Reynolds was traveling yesterday and unavailable for comment.

Reagan also said that his administration is "dedicated and devoted to the principle of civil rights . . . in spite of the fact that I do believe in returning more to our system of federalism, recognizing that there are functions that can be better performed at the state and local level.

"I recognize also that one of the prime responsibilities of the federal government is to assure that not one single citizen . . . can be denied his or her constitutional rights without the federal government coming in and guaranteeing those rights," Reagan said.

Asked about extending the Voting Rights Act, Reagan said he believes the government should be required to prove "intent" to discriminate in local voting laws rather than simply the existence of the "effects" of discrimination.

The House has passed, 389 to 24, an extension providing that it is not necessary to prove intent. A group of 61 senators also announced this week that they are co-sponsoring identical legislation.

But Reagan said, "The 'effect rule' could lead to the type of thing in which effect could be judged if there was some disproportion in the number of public officials who were elected in any governmental level . . . . We don't think that . . . would be a fair test. You could come down to where all of society had to have an actual quota system."