I created a connection using ifconfig wlandev and set it up to use DHCP. The connection is made but then stops after a short while. There doesn't seem to be any issues with the hardware. Doing the following restores the connection.
ifconfig wlan0 down
ifconfig wlan0 up