The agent was correct, assuming you have a restricted ticket. Many years ago UA would allow you to up-fare without penalty, but not today.
One thing you might be able to look at is upgrading online to First/Business. UA allows you to 'buy up' online, when available, without paying a change fee.