‘Contested case’ means a proceeding, including but not restricted to rate making and licensing, in which the legal rights, duties or privileges of a party are required by law to be determined by an agency after an opportunity for hearing, or in which an administrative penalty may be imposed.