A somewhat old-fashioned or literary term for a foolish person; often used in historical or dramatic contexts. Can be insulting but may also carry a slightly affectionate or pitying tone.
馬鹿 is the common, everyday word for 'fool' or 'idiot'. うつけ者 is more literary and old-fashioned, with a nuance of being out of touch with reality rather than simply stupid.
阿呆 is a Kansai-region variant of 馬鹿, also common and casual. うつけ者 is not dialectal and has a more classical feel.
Etymology
Derived from the verb うつける (to become empty-headed or absent-minded) plus 者 (person). The exact historical derivation is uncertain, but the term has been used since the medieval period to describe a person who seems vacant or foolish.