Authorities have declared a state of emergency in New South Wales, and the military is using boats to deliver supplies after fires have killed at least 18 people.