A "tired" Roger Federer was "incredibly happy" to mark his long-awaited return with a battling victory over Dan Evans in the second round of the Qatar Open.