"I put a cup on the desk."
That would be more accurate, but not completely necessary. If the desk had no drawers it would be fairly obvious that it means 'on'. If the desk had drawers it would probably be better to use 上に. However, if you wanted to say 'Put the cup in a desk drawer' you would use the verb 入れる（いれる）。In this case you can even omit the word 'drawer'. 置く（おく）means to set down or place on an unobstructed surface.
机の引き出しにカップを入れてください。- Put the cup in the desk drawer.
It couldn't mean that. つくえ is desk. ひきだし is drawer. If someone wanted the cup in a drawer they would use ひきだしに or つくえのひきだしに. Again, you put things IN a drawer 入れる and you put things ON a desk (置く）.
The only difference using 上 would be equivalent to the difference in English between 'Put the cup on the desk' and 'Put the cup on top of the desk'.