Obama offers help after attacks in Egypt, Nigeria