Job of Producer versus Recording Engineer

Can someone explain the difference between what a producer does and what a recording engineer does in a recording studio? Does it vary depending on the type of music?
producer is the one who financially promotes albums and artists.

recording engineer simply the one in-charge of the recording process of the above mentioned items.
I'm not sure that that is a correct explanation with respect to recording as opposed to movie/theater. My understanding is that the producer of a recording directs the mix, sets the flavor, chooses the overall direction of the recording. Well known producers have a "sound" that they are known for, like Phil Spector, Don Was, Quincy Jones, etc. I may very well be wrong, but I thought that a record prdocuer is more like a director of a movie or play. The money is usually put up by the record label.
The recording engineer will set up the mics and associated gear,and pending on the type of producer, some more involved in the actural mix then others,may do the mix as well. But the final tracks at least would be given the ok by the performer and producer.
It's not always clear cut, but the producer is responsible for the overall sound and vibe of a recording while the engineer is responsible for getting that sound on tape. It really depends on the specific people involved and the roles can heavily overlap.
Producer is in charge of the full chain for making the final product and the budget - he or she is contracted by the recorded label or artist. He of she subcontracts the people involved to record and master the music. Producers often have people they like and are used to working with, hence the sound. Producers don't actually mix or master with actual equipment but they are in charge and do make QC decisions (often along with the artist).
It's simpler to say what an engineer does: this is a person who is responsible for implementing the technical aspects of the recording, mixing, and mastering processes. Engineers physically run the recording/mixing/mastering studios. By default and/or necessity it's also not unusual for engineers to have some input into the more artistic type of decisions, especially regarding sound, that are normally thought of as the province of the artist and the producer (and for which they often receive no public acknowledgement).

What a producer can do varies more widely, mostly depending on the type of music being recorded and the scope and budget of the sessions. Traditionally, the rough analogy with films goes something like this: record label = movie studio, label A&R (artist and repertiore) person = movie producer, and record producer = film director. This is a flawed analogy of course, not least because more often in music the 'actors' are also the writers and/or creative decision-makers as well as the performers. In practice the record producer's role can range anywhere from mostly an advisory role to the self-directed, creative artist, all the way to 'svengali' status where the 'artist' is basically just doing the producer's bidding, i.e. given material to record and told how to perform it. But in general, the producer can best be looked at as being either the 'musical director' or the 'sound director' of the recording sessions, or both, with the artist depending on the producer to help formulate and translate their intentions into a plan of action that is then carried out with the help and expertise of the engineers. Session producers don't always participate in the mixing and/or mastering processes (more often they do only with the former), but the final OK on many artistic and sound decisions, at least within the major-label context, often ulitmately comes from the A&R people in combination with the label heads. Of course when the producers and/or artists are bigger names, or even get their own label imprints, they get more say-so over the final product.
Shardone, that's a good definition of a producer, but it doesn't fit all situations. A current trend in pop music is to bring in a different producer for individual album tracks. For a flat fee the "producer" comes in and sprinkles his signature sound upon the artist with the goal being a hit record. In other situations there is no producer. A band without a label rents a few days in a studio, hires an engineer and record enough songs for a CD. If the band has no studio savy, the engineer will have to do things a producer will normally have input on, but essentially the CD has no producer.

It's more likely that a producer will have engineering chops than an engineer having a true flair for production, but the line is still very fluid with people doing both jobs. It's common for an engineer to ask for production credit, but rarely the other way around.
Gotta think that role defining along these lines will be a slippery frog when variations in genres, labels, projects and personalities are factored in. Two examples come to mind: Charles Gerhardt, a Julliard trained pianist turned recording engineer often took up the baton to conduct sessions that he was recording. And for the inverse, there was Leo Stokowski, the conductor turned sound engineer who directed mic placement and spent more time at the console than on the riser for many of London’s over-maligned “Phase-4” recordings.
In both instances, a case can be made that the “Producers” were reduced to names on a jacket and that these two forceful personalities left their creative stamps as producers of those recordings.