You'll need to create a wan network in /etc/config/network:
config interface 'wan'
option proto 'dhcp'
The proto dhcp causes OpenWrt to start a DHCP client on that network. The network should be named exactly 'wan' in lower case. This is because that name already exists in the firewall for proper NAT forwarding to the Internet, and rejection of incoming connections.
Then in /etc/config/wireless, associate the wifi-iface with the wan network:
config wifi-iface
option network 'wan'
...
At run time this interface will probably be named 'wlan0' however that does not matter, as the wan functionality, DHCP client, and firewall association will follow the dynamically generated name whatever it may be.