The UK maritime agency said that armed men attacked a commercial cargo ship near the coast of Al Mahaf, Yemen, and took control of it.