Ernest W. Lefever, who withdrew his name last month from consideration as President Reagan's nominee to the State Department's top human rights post after being rejected by a Senate committee, has been sworn in as a consultant to Secretary of State Alexander M. Haig Jr., the State Department said yesterday.

Lefever will advise Haig on terrorism, counterterrorism and nuclear nonproliferation issues and the "cohesiveness of State Department policy in these areas," according to department spokesman Joe Reap.

Reap said Lefever also may be assigned to "special projects" and will advise Haig on "such other matters relating to the conduct of foreign affairs as the secretary may request," a job description that neither specifically mentions nor rules out the possibility of Lefever acting as an adviser on human rights policy.

Despite the continued backing of Reagan and his top aides, Lefever lost his confirmation fight in the Foreign Relations Committee on a 13-to-4 vote June 5, a day after a six-hour closed session in which senators grilled him on his relationship with the Swiss-based Nestle Corp. and some previous statements on Israel.

The nominee had drawn wide-spread criticism because of his greater tolerance for human rights abuses in contries allied to the United States and his connections with Nestle, a major promoter of infant formula in the Third World. Nestle had contributed funds to the Ethics and Public Policy Center, which Lefever heads, and the center later distributed a study favorable to the formula.

The World Health Organization, with the United States alone in opposition, recently passed a resolution calling for restrictions on formula advertising and distribution in the Third World.

As an assistant secretary-disignate, Lefever was sharply critical of the Carter administration's human rights policy, and told the committee that he favored instead a two-level approach that would differentiate between human rights abuses in communist countries and abuses in righist dictatorships allied to the United States.

As a consultant, Lefever will be eligible to work for the department a maximum of 130 days a year and will be paid, on a per-diem basis, at the same rate as a GS15. A GS15 makes about $44,000 a year.