Initially G-d had called out the entire nation of Israel to be a nation of priests, which would be His representatives to the world. This was to be accomplished by sanctifying all firstborn males. (Ex. 13:11-13, 22:29, 34:19 and Num 18:15)

Exodus 19:5-6 Now therefore, if ye will obey my voice indeed, and keep my covenant, then ye shall be a peculiar treasure unto me above all people: for all the earth is mine: And ye shall be unto me a kingdom of priests, and an holy nation. These are the words, which thou shalt speak unto the children of Israel.

It appears that prior to the golden calf episode Aaron and his sons were selected to minister in the temple as the priests. The firstborn males from the rest of the tribes were to minister to the priests.

Exodus 28:1 And take thou unto thee Aaron thy brother, and his sons with him, from among the children of Israel, that he may minister unto me in the priest's office, even Aaron, Nadab and Abihu, Eleazar and Ithamar, Aaron's sons.

The privilege of being a kingdom of priests rested upon their obedience to the covenant. In Exodus 32 we read how this covenant was broken when the nation worshipped the golden calf, thus abolishing their privileged position as a kingdom of priests. It was at this time that the Levites were chosen over the firstborn from the nation.

Exodus 32:26 Then Moshe stood in the gate of the camp, and said, Who is on the L-RD's side? let him come unto me. And all the sons of Levi gathered themselves together unto him.

The priests, Aaron's sons, ministered to G-d and the rest of the Levites ministered to the priests.

Tasks that were performed by the priests:

The task of taking down and setting up of the tabernacle was the work of the three sons of Levi: the Kohathites, the Gershonites and the Merarites. (Num 3 and 4)