It would depend on why they died. If it was a highly contagious disease you would probably catch it. If they died of a heart attack then it is likely that nothing would happen. I am assuming here that you are speaking about someone that has not been dead for a very long time. Once a body starts decaying there could be other things to consider.
90% of the time it's fine. People kiss and touch loved ones who have passed at the hospital and funeral home. They would of had to die from a very powerful contagious disease for anything bad to happen. Now if we are talking about a wild animal that has died the chances are much greater of contracting something.