I've definitely noticed that staying up late (or similarly being awake after not getting enough sleep) harms memory recall, motor tasks, and concentration/logic.
But, lack-of-sleep also sometimes offers a slight euphoria or creativity/disinhibition in thinking. The mechanism might even be the same: certain parts of the brain that normally moderate mood or inhibit certain lines of thought fall asleep on their own. So, the remaining parts of the brain party.