Rafter is the better player. However, looking at titles and all that Djokovic has the better career.
Questionable if you compare Djokovic and Rafter:
Serve: Little in it although Djokovic has more variety while Rafter mostly served a very good kick serve.
Forehand: Djokovic well ahead.
Backhand: Djokovic well ahead.
Return of serve: Djokovic well ahead.
Passing shots: Djokovic well ahead.
Volley: Rafter in a different league and well ahead.
Overhead: Rafter in a different league and well ahead.
Movement: Slight edge to Djokovic.
Mental toughness: Little difference.
Rafter was a better attacking player with an exceptional net game. Djokovic seems to be much better in every other aspect.