At least 40 people have been killed and several hundred more injured after an explosion and fire at Iran's largest port, according to state media.