This circuit can switch on or off by the switch connected to the 12V battery, so by help of the MosFet it can use the power from AC source if it available, otherwise the battery will supply the LED. Note that this circuit doesn't consume any current from battery for the control and relay.