Nyasam literally means 'placing'. Touching the various parts of the body with the specific mantras is called nyasam.
Please allow me to elaborate further.
nyAsa in Sanskrit also means putting down or in, fixing, inserting, applying, impressing, drawing, painting,
writing down. By means of doing the nyAsa what the devotee is supposed to be doing is to imagine that the various characteristics as denoted by the nyAsa mantras are impressed or embedded on his respective organs which are either touched or some sign is made. Thus the divinity which is worshipped is imagined to have been invited (avAhana) into the worshipper's body.
Usually nyAsa consists of rishi, chandas,dEvatA, beejam, Sakti, mantra, keelaka (peg, bolt, wedge), astra (dart, bow, arrow), nEtra, kavaca (shield), yOni (place of origin or abiding), digbandha (binding the directions), dhyAna and then japa of the mantra.
while saying "rishi" one touches the top of the head - it signifies that he bows down to the rishi for the mantra.
chandas - this refers to the poetic meter of the mantra; it also means the unrevealed aspect. The lips are touched while saying the chandas. But touching the lip will make the hand impure and so the portion just above the lip is touched. The mouth utters the mantra in proper meter while the mind should (try to) grasp the hidden meaning of the mantra.
dEvatA - the deity invoked by the mantra; the heart is touched. The dEvatA is placed in the heart.
Similarly there are signs for the other items also. This is called "anga nyAsa". In addition to the above there are "kara nyAsa" and "hridayAdi nyAsa" as well. When all these are completed, the person chanting the mantra is supposed to have embedded in his self the various aspects of the deity. It is also a requirement that after doing these nyAsas one should not rise from his seat till the chanting of the entire mantra is completed and no other type of disturbance is answered.
These nyAsas are a mild aspect of the tantric mode of worship. Our vEdas did not approve of tantra as a desirable form of worship. Nevertheless many aspects of tantra have crept into our rituals.