An engineer handles the more technical aspects of the recording process such as mic and mic placement, what type of processing (eqs, compressors and reverb/delay) to apply to the sound. The producer is in charge of the big picture and making sure that the sounds the engineer are using work for the production he/she is trying to create.
A good way to describe this in very simple terms is that the producer can say "I'm looking for a U2 "Streets Have No Name" guitar sound" and the engineer figures out the best way to technically achieve that. The producer comes up with the idea of what he/she wants to hear and it's the engineers job to do it.
It's important to note that the producer is in charge of all the pieces of the recording: song arrangement, musicians, and the final sound and mix. The engineer is another piece of this puzzle handling one part of the final product. It's also important to mention that these roles sometimes get blended together; sometimes the producer will jump on the computer and adjust something and sometimes the engineer will offer opinions on the production. In fact the final product is often better because of this intermingling of roles, especially when the producer and engineer work together.
I do both engineering and production on various projects depending on what my client wants. You can check out what I've been up to at the below sites:
Catch me on the sites: