This would probably not be a drunk driving offense.
Under the UK "drunk in charge of a motor vehicle" law:
How is “in charge” defined?
There is no definition of “in charge” and the courts have been keen to
avoid an all-embracing test.
In determining if a person is in charge the court will consider:
Whether he was in the vehicle, if so where, or how far he was from it;
What he was doing at the time;
Whether he was in possession of the key for the ignition;
Whether there was any evidence of an intention to take some form of
control of the vehicle;
Whether any person was in or near the vehicle and if so the
particulars of that person.
You could also be prosecuted if you are found in the passenger seat or
the back seats. You do not have to be sitting in the driver’s seat to
be considered “in charge”.
However those that own or lawfully are in possession of the vehicle or
have recently driven it are deemed to remain in charge unless it can
be shown:
that they had put the vehicle into someone else’s charge
or can establish that they had ceased to be in control AND there was
no realistic prospect of resuming control whilst unfit.
Are there defences available?
The law states that someone cannot be convicted of an “in charge”
offence if they can prove there was no intention and / or likelihood
of the vehicle being driven whilst the driver was over the prescribed
limit.
Unlike many other offences, with the offence of being drunk in charge,
the accused must prove that they did not have any intention to drive
the vehicle. The prosecution is not required to prove that the accused
was likely to drive whilst unfit or over the limit.
A defence is available if it can be shown that there was no likelihood
of driving whilst over the prescribed limit and doing this should be
established by expert scientific evidence or compelling circumstantial
evidence. These defences are known as “statutory defences”.
Section 5 of the Road Traffic Act 1988 states:
“The defendant must prove that it was more likely than not that he had no intention of driving whilst the level of alcohol in his breath,
blood or urine remained above the prescribed limit in which case, he
is not considered to be in charge”.
Our question is, if you "leave the keys on the front seat, the engine off and get in the back to sleep it off, would they have comitted an offense?"
Since the person in the question had an intent to "sleep it off" rather than to operate the car while under the influence, he (or she) has not committed an offense. The burden of proof would be on him (or her) to establish that intent, but sleeping in the backseat with the engine off and the keys out of the ignition in the front seat, would be pretty compelling circumstantial evidence of a lack of an intent to operate the car while under the influence.
There might also very well be a local ordinance prohibiting sleeping in a car in a particular place, but it wouldn't be a traffic violation.