could be the cam on the hinge...they are plastic and sometimes wear out or crack. There is usually one on the hinge and one on the door.
also could be shelves or food keeping it from closing. I would remove everything from the door and/or inside the refrigerator and test the door as you go. it will take about half an hour but you can clean it while you are at it. if door closes properly, start replacing shelves and you are done.