This will work for you:
CHG is the battery charger, BAT is the 12V battery, LOAD is the amp, and K1 is a Double-Pole Double-Throw relay, with K1A being one set of contacts and K1B being the other.
"NC" refers to the normally closed fixed contacts, "NO" to the normally open fixed contacts, and "C" to the movable common contacts.
In operation, what happens is that the common contact (the slanty line) is spring-loaded and, when there's no power to the coil, the spring's tension forces the common contact up against the normally closed contact, creating an electrical connection between them. When power is applied to the coil, however, the magnetic field generated by the coil attracts the common contact away from the normally closed contact, breaking that connection and forcing the common contact up against the normally-open contact, which creates an electrical connection between the normally-open and the common contacts.
The action is similar to that of a double-pole double-throw toggle switch except that the switching is done electrically instead of manually.
With the 18V supply disconnected from the circuit, the relay will be de-energized and the connection between the charger and the battery will be broken, but the connection between the battery and the load (the amp) will be made through K1B-NC and C, allowing the amp to run off the battery.
With the 18V supply connected to the circuit, the relay will be energized and the battery will be disconnected from the load and connected to the charger through K1A-NO and C, allowing the battery to be charged.
In addition, the load will now be disconnected from the battery and connected to the 18V supply through K1B-C and NO, allowing the amp to be run from the 18V supply while the battery is charging.