This sounds like a macabre version of one of those teambuilding exercises.
As noted above, your emotions will be going haywire and you won't think clearly. You'll probably stay with your fallen friend for some time before you get your thoughts in order.
- First priority is your safety
- Second priority is immediate first aid
- Third priority is communication (if you have a communication method), seek and follow further advice from the authorities)
- Fourth priority is to continue to administer first aid until you're absolutely sure of the situation
If your friend is undoubtedly dead, then your own safety becomes paramount. If you can't safely get to the body, then you can only leave it in situ until you get the authorities there (by whatever means).
In the unlikely event the body is in the open and readily to hand, then practically speaking, protecting the dignity of your friend (and family) is most important.
If you have no means of contacting the authorities from where you are and have to travel some distance to gain help/communication:
I'd empty his/her back-pack and insert the body's head/shoulders as far as they'll go. Secure the opening as tight as possible with his/her belt (if predators get to the body, they'll start with the more accessible parts). You can then cover the remains with branches/foliage/rocks/whatever in an effort to protect from predation. Protecting the head/upper chest also preserves any evidence for any subsequent medical investigation.
Mark the location of the cairn as clearly as possible (use a nearby tree or rock that won't be dislodged by predators).
Use the remaining contents of the back-pack to help mark your route back to the closest, easiest, route to a communications point (where you get a cell signal or people).
Don't forget to mark your exact location on a map before you set off.
If you have communication equipment:
Obviously, use the equipment and stick with the body - direct the authorities to you unless instructed otherwise.
Note: I have no experience or training to back this up. It just seems appropriate.