Enemies during the early personal-computer wars, Apple and IBM said they will cooperate in the mobile era, striking an agreement to create simple-to-use business apps and sell iPhones and iPads to Big Blue’s corporate customers.