That diode-mixing will look something like this ...
Code:
.-----. : P
Mains >--.--| PSU |-----:-----------^-|>|---.-------------> 12V
| | |--. : |
| `-----' | : |
| .-----. | : B | .-----.
`--| BAT |--|--:---|>|---.-^-|>|---^---| REG |---> 5V
| CHG |--{ : __|__ `--.--'
`-----' | : ___ BATTERY |
| : | |
`--:---------^----------------^------> 0V
:
As long as mains is present, the voltage at P is greater than at B, the entire system will be powered from the mains supply. As soon as mains fails and P drops below B, the system will be powered from the battery.
You can ensure P is greater than B through selection of the PSU or by adding extra diodes in the battery supply before B.
There are no relay contacts because where power (current) is taken from is a matter of voltage potential; when P is a higher voltage than B current will never come from B, and current won't get from P to B because it has a 'reversed diode' blocking that.