Step1
Generally, the producer is the person who assumes both creative and financial control of the recording production.
When hired by a record label, they act as the liaison between the artist and the record label's A&R department.
They are expected to deliver a record on time and within the budget set forth by the label.
The demands for a producer are quite stringent as I'm sure you can see. Having to cater to both the artistic and monetary sides of the production can be a great challenge. Those who can do it grace are the ones who are hired more often. It's a balancing act for sure.
Step2
On the artistic side the producer is the person who acts as a confidante, cheerleader, dictator, psycologist, objector and best friend to the artist. When contracted by an artist, the producer has to assume responsibility for the artist as though they were his own children. It's very much like a marriage.
Depending upon the level of musical skill, the producer will often be asked to help with the composition and arrangement of the songs. He can also provide whatever skills he possesses to the project. Often performing various guitar, background vocals and other miscellaneous parts.
In some situations, the producer may contribute to the composition to the point at which, his contributions are a legitimate component of the song and should be granted co-ownership of the song's copyright.
Step3
The engineer is responsible for creating the best sonic results expected from both the artist and producer. In most cases the artist and producer work together to create the best songs.
The engineer takes direction from the producer. The producer will provide an overview of what he intends to achieve sonically. The engineer is expected to be able to provide the necessary techniques in order to achieve these sounds.
The engineer should have a vast knowledge of which microphones, preamps, compressors, EQs and other equipment work best for the application at hand. He should be able to complete the task quickly and efficiently without holding up the creative process. Once the musical ideas start to flow, you'd better be ready to capture them.
Step4
On a more indie level, local recording studios will often provide an in-house engineer who handles all tasks within the production. This can be both good and bad depending upon his level of skill in all facets of the production. Do not assume that they have musical skill. Many engineers do not have musical backgrounds and thus cannot contribute or provide direction in that manner. They tend to have backgrounds in sound reinforcement, electrical engineering or sound reproduction--the more technical stuff.
Be very aware of what these studios can provide to you. Sometimes the one-stop-shops are not all they profess to be and can leave you disillusioned and unfulfilled.
Remember that just as with medical treatment we expect greater results from specialists as opposed to just the family doctor.
You probably wouldn't want to have your general practitioner perform your lobotomy.