The type or namespace name ‘UI’ does not exist => humm weird. Where do you have this error, line 3? UI should be automatically at your references.
The type or namespace name ‘MonoBehavior’ could not be found => That’s because you have removed using UnityEngine; (without UI). It contains MonoBehaviour.